/**
 * 项目名称: LCR_141.cpp
 * 项目路径: study/DataStructure/LinkedList/LeetCode/剑指Offer
 * 编辑时间: 2024年06月28日20时11分32秒
 * 用   户: 轻尘
 */

#include <bits/stdc++.h>

using namespace std;

struct ListNode {
    int val;
    ListNode *next;

    ListNode() : val(0), next(nullptr) {}

    ListNode(int x) : val(x), next(nullptr) {}

    ListNode(int x, ListNode *next) : val(x), next(next) {}
};

class Solution {
public:
    ListNode* trainningPlan(ListNode* head) {
        if(!head)return nullptr;

        ListNode * head_pointer = nullptr , * tmp = head, * tail_pointer = nullptr;
        while (tmp){
            tail_pointer = tmp->next;
            tmp->next = head_pointer;
            head_pointer = tmp;
            tmp = tail_pointer;
        }
        delete tmp,tail_pointer;
        return head_pointer;
    }
};

int main() {

    return 0;
}
